package io.zjw.testblelib;

import android.util.Log;

import org.java_websocket.client.WebSocketClient;
import org.java_websocket.drafts.Draft_6455;
import org.java_websocket.handshake.ServerHandshake;

import java.net.URI;

public class MyClient extends WebSocketClient {
    public MyClient(String serverUri) {
        super(URI.create(serverUri),new Draft_6455(),null,0);
    }

    @Override
    public void onOpen(ServerHandshake handshakedata) {
        Log.i("MyClient","-------------onOpen");
    }

    @Override
    public void onMessage(String message) {
        Log.i("MyClient","------------onMessage");
        Log.i("MyClient","------------"+message);
    }

    @Override
    public void onClose(int code, String reason, boolean remote) {
//        Log.i("MyClient","onClose");
    }

    @Override
    public void onError(Exception ex) {
//        Log.i("MyClient","-------------------onError");
//        Log.i("MyClient","-------------------"+ex.getMessage());
    }
}
